---
title: IReport
summary: API reference for IReport.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-08-21
library: SAIF.Services.Printing
reference_type: embedded
---

# IReport

`IReport` is the contract that defines a report's lifecycle in this library — create the report's xPression
data document, render it to bytes, and print, distribute, or save the rendered output — plus the error
collection and default/draft output-profile selection every implementer must expose. `ReportBase` is the sole
implementer in this repository; concrete report subclasses in consuming libraries implement this contract
indirectly through `ReportBase`.

## Purpose
- Define the report lifecycle operations (`Create`, `Render`, `Print`, `Distribute`, `Save`) that every report
  type in this library must support
- Define the non-throwing error surface (`Errors`) so callers can inspect failures without exception handling
- Define the report-identity properties (`DestinationFileName`, `OutputProfile`, `ReportPackage`, `ReportFile`,
  `ReportXml`) shared by every report

## Context
- Namespace: `SAIF.Services.Printing.Reporting`
- Assembly/package: `SAIF.Services.Printing` (embedded library, project reference)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `Errors` | `ReadOnly Property Errors As List(Of ErrorDetail)` | Accumulated non-throwing failures from `Render` and `Distribute` ([BR-PRT-010](../../business-rules.md#br-prt-010-non-throwing-render-and-distribute-failures)) |
| `xPrint` | `ReadOnly Property xPrint As clsPrint` | The `clsPrint` instance used to preview, print, and distribute this report's rendered output |
| `DestinationFileName` | `Property DestinationFileName As String` | File path used by `Save` to persist the rendered report to disk |
| `OutputProfile` | `Property OutputProfile As String` | xPression output profile applied on render; set by `SetDefaultProfile`/`SetDraftProfile` ([BR-PRT-015](../../business-rules.md#br-prt-015-draft-versus-final-output-profile)) |
| `ReportPackage` | `Property ReportPackage As String` | xPression package name for this report; required before render/distribute can proceed ([BR-PRT-008](../../business-rules.md#br-prt-008-render-and-distribute-preconditions)) |
| `ReportFile` | `Property ReportFile As Byte()` | Cached rendered document bytes; populated by `Render` |
| `ReportXml` | `Property ReportXml As XDesignXDocument` | The xPression data document produced by `Create` |
| `Create` | `Function Create(overwrite As Boolean) As XDesignXDocument` | Builds this report's xPression data document; the only member concrete report subclasses are expected to override |
| `Render` | `Function Render(overwrite As Boolean) As Boolean` | Renders the report's data document into `ReportFile`, subject to caching ([BR-PRT-007](../../business-rules.md#br-prt-007-render-result-caching)) |
| `Print` | `Function Print(printer As String, overwrite As Boolean) As Boolean` | Renders (if needed) and prints the report to the given printer |
| `Distribute` | `Function Distribute(overwrite As Boolean) As Boolean` | Builds (if needed) and distributes the report's raw XML via `clsPrint.distributeDocument` |
| `Save` | `Function Save(overwrite As Boolean) As Boolean` | Renders (if needed) and writes `ReportFile` to `DestinationFileName` ([BR-PRT-014](../../business-rules.md#br-prt-014-destination-file-overwrite-protection)) |
| `SetDefaultProfile` | `Sub SetDefaultProfile()` | Sets `OutputProfile` to the final (non-watermarked) `PDF` profile ([BR-PRT-015](../../business-rules.md#br-prt-015-draft-versus-final-output-profile)) |
| `SetDraftProfile` | `Sub SetDraftProfile()` | Sets `OutputProfile` to the `PDF_Draft_Watermark` profile ([BR-PRT-015](../../business-rules.md#br-prt-015-draft-versus-final-output-profile)) |

## Behavioral notes
- The interface itself carries no implementation; all lifecycle semantics (caching, precondition checks,
  non-throwing failure capture) are defined by the sole implementer, `ReportBase`.

## Constraints and usage notes
- No concrete `ReportBase` subclass exists in this repository's built projects; the only sample implementing
  this contract lives in a test project excluded from the solution.*

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts.

## Sources
- SAIF.Services.Printing/Reporting/IReport.vb
